package ui
{
	import display.ImageSlot;
	import display.LoadingIcon;
	
	import flash.display.DisplayObject;
	import flash.display.Graphics;
	import flash.display.Sprite;
	import flash.filters.DisplacementMapFilter;
	
	import globals.$athena;
	import globals.$loadManager;
	
	import loaders.LoadItem;
	
	import slices.BlankTime;
	import slices.InvokeFunction;
	
	public class UIShopDialogItem extends Sprite
	{
		public var id:int;
		
		public static var W:int = 120;
		public static var H:int = 160;
		
		public var slot:ImageSlot = new ImageSlot;
		
		public function UIShopDialogItem()
		{
			super();
			var g:Graphics = this.graphics;
			g.lineStyle(8, 0xc5a069);
			g.drawRoundRect(0, 0, W, H, 10, 10);
			addChild(slot);
		}
		
		private function onLoad(item:LoadItem):void {
			var d:DisplayObject = item.loader.getContent() as DisplayObject;
			slot.changeTo(d);
		}
		
		public function setImage(path:String):void {
			var loading:LoadingIcon = new LoadingIcon;
			loading.x = W/2;
			loading.y = H/2;
			slot.changeTo(loading);
			$loadManager.add(path, onLoad);
		}
				
		
	}
}